// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.popman;

import java.util.LinkedList;
import zombie.characters.IsoZombie;
import zombie.core.raknet.UdpConnection;

public class NetworkZombieList {
    final LinkedList<NetworkZombieList.NetworkZombie> networkZombies = new LinkedList();
    public Object lock = new Object();

    public NetworkZombieList.NetworkZombie getNetworkZombie(UdpConnection connection) {
        if (connection == null) {
            return null;
        } else {
            for (NetworkZombieList.NetworkZombie networkZombie0 : this.networkZombies) {
                if (networkZombie0.connection == connection) {
                    return networkZombie0;
                }
            }

            NetworkZombieList.NetworkZombie networkZombie1 = new NetworkZombieList.NetworkZombie(connection);
            this.networkZombies.add(networkZombie1);
            return networkZombie1;
        }
    }

    public static class NetworkZombie {
        final LinkedList<IsoZombie> zombies = new LinkedList();
        final UdpConnection connection;

        public NetworkZombie(UdpConnection _connection) {
            this.connection = _connection;
        }
    }
}
